/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufscar.compiladores.ast;

/**
 *
 * @author takeshi
 */
public class AssignmentCommand extends Command{
    
    private Variable v;
    private Expr expr;
    
    public AssignmentCommand(Variable v, Expr expr) {
        this.v = v;
        this.expr = expr;
    }
    
    @Override
    public void genC(PW pw) {
        pw.print(v.getName() + " = ");
        expr.genC(pw, false);
        pw.out.println(";");
    }
    
}
